package xin.cms.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import xin.cms.enums.CheckStatus;
import xin.core.jpa.JpaConstant;
import xin.core.jpa.model.AutoDateUUIDEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * <pre>
 * 评论表
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2018/8/8
 */
@Entity
@Table(name = "cms_comment")
@Data
@EqualsAndHashCode(callSuper = true)
public class Comment extends AutoDateUUIDEntity {

    @Column(name = "_type",length = JpaConstant.EnumStringShortColumnLength)
    private String type;

    /**
     * 评论内容
     */
    @Column(columnDefinition = "longtext")
    private String content;

    /**
     * 内容ID
     */
    @Column(length = JpaConstant.UidColumnLength)
    private String ownId;

    /**
     * 状态
     * @see CheckStatus
     */
    @Column
    private CheckStatus status;

    /**
     * 评论者（用户登录名）
     */
    @Column(length = JpaConstant.NameColumnLength)
    private String author;

    /**
     * 评论者ID（用户ID）
     */
    @Column(length = JpaConstant.UidColumnLength)
    private String authorId;
}
